USE [SRD]
GO

/****** Object:  Table [dbo].[DESPESA]    Script Date: 05/14/2011 11:01:44 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[DESPESA](
	[DESPESA_ID] [int] IDENTITY(1,1) NOT NULL,
	[DESCRICAO] [nvarchar](50) NOT NULL,
	[VALOR] [float] NOT NULL,
	[TIPO_DESPESA_ID] [int] NOT NULL,
	[SUBMISSAO_ID] [int] NOT NULL,
 CONSTRAINT [PK_DESPESA] PRIMARY KEY CLUSTERED 
(
	[DESPESA_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[DESPESA]  WITH CHECK ADD  CONSTRAINT [FK_DESPESA_SUBMISSAO] FOREIGN KEY([SUBMISSAO_ID])
REFERENCES [dbo].[SUBMISSAO] ([SUBMISSAO_ID])
GO

ALTER TABLE [dbo].[DESPESA] CHECK CONSTRAINT [FK_DESPESA_SUBMISSAO]
GO

ALTER TABLE [dbo].[DESPESA]  WITH CHECK ADD  CONSTRAINT [FK_DESPESA_TIPO_DESPESA] FOREIGN KEY([TIPO_DESPESA_ID])
REFERENCES [dbo].[TIPO_DESPESA] ([TIPO_DESPESA_ID])
GO

ALTER TABLE [dbo].[DESPESA] CHECK CONSTRAINT [FK_DESPESA_TIPO_DESPESA]
GO


